let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let crossProduct = data["crossProduct"];
let dotProduct = data["dotProduct"];
let compareVectorAngles = data["compareVectorAngles"];
let sineOfAngle = data["sineOfAngle"];
let cosineOfAngle = data["cosineOfAngle"];
let closestPoint = data["closestPoint"];
let horizontalIntersection = data["horizontalIntersection"];
let verticalIntersection = data["verticalIntersection"];
let intersection = data["intersection"];
let perpendicular = data["perpendicular"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let Segment = data["Segment"];


console.log("09PolygonClipping_geom-in02");

function PolyIn(geomPoly, multiPoly) {
  this.getSweepEvents = function () {
    const sweepEvents = this.exteriorRing.getSweepEvents();
    for (let i = 0, iMax = this.interiorRings.length; i < iMax; i++) {
      const ringSweepEvents = this.interiorRings[i].getSweepEvents();
      for (let j = 0, jMax = ringSweepEvents.length; j < jMax; j++) sweepEvents.push(ringSweepEvents[j])
    }
    return sweepEvents
  }, this.init = function (geomPoly, multiPoly) {
    if (!Array.isArray(geomPoly)) throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
    this.exteriorRing = new geomIn.RingIn(geomPoly[0], this, !0), this.bbox = {
      ll: {
        x: this.exteriorRing.bbox.ll.x,
        y: this.exteriorRing.bbox.ll.y
      },
      ur: {
        x: this.exteriorRing.bbox.ur.x,
        y: this.exteriorRing.bbox.ur.y
      }
    }, this.interiorRings = [];
    for (let i = 1, iMax = geomPoly.length; i < iMax; i++) {
      const ring = new geomIn.RingIn(geomPoly[i], this, !1);
      ring.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = ring.bbox.ll.x), ring.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = ring.bbox.ll.y), ring.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = ring.bbox.ur.x), ring.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = ring.bbox.ur.y), this.interiorRings.push(ring)
    }
    this.multiPoly = multiPoly
  }, this.init(geomPoly, multiPoly)
}

geomIn["PolyIn"] = PolyIn;

return {
  "utils": utils,
  "STUtil": STUtil,
  "Node": Node,
  "SplayTree": SplayTree,
  "isInBbox": isInBbox,
  "getBboxOverlap": getBboxOverlap,
  "cmp": cmp,
  "crossProduct": crossProduct,
  "dotProduct": dotProduct,
  "compareVectorAngles": compareVectorAngles,
  // "length":length,
  "sineOfAngle": sineOfAngle,
  "cosineOfAngle": cosineOfAngle,
  "closestPoint": closestPoint,
  "horizontalIntersection": horizontalIntersection,
  "verticalIntersection": verticalIntersection,
  "intersection": intersection,
  "perpendicular": perpendicular,
  "rounder": rounder,
  "geomIn": geomIn,
  "Segment": Segment
}